﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AnaxibiaStudios.BeanPermutator
{
  public abstract class PermuteBase<T> : IPermute<T>
  {
    protected IList<T> _source;

    public Func<T, T, bool> CanSwap { get; set; }
    public IEnumerable<T> Source { get { return _source; } }
    object System.Collections.IEnumerator.Current { get { return Current; } }

    public abstract IEnumerable<T> Current { get; }
    public abstract void Dispose();

    public abstract bool MoveNext();
    public abstract void Reset();

    public PermuteBase(IList<T> source, Func<T, T, bool> canSwap)
    {
      _source = source;
      CanSwap = canSwap;
    }
  }
}
